<script type="text/javascript" >

window.onload = function (){

	var oStar = document.getElementById("star");
	var aLi = oStar.getElementsByTagName("li");
	var oUl = oStar.getElementsByTagName("ul")[0];

	var i = iScore = iStar = 0;
	
	for (i = 1; i <= aLi.length; i++){
		aLi[i - 1].index = i;
		
		//鼠标移过显示分数
		aLi[i - 1].onmouseover = function (){
			fnPoint(this.index);
			//浮动层显示
			
			//计算浮动层位置
			
			};
		
		//鼠标离开后恢复上次评分
		aLi[i - 1].onmouseout = function (){
			fnPoint();
			//关闭浮动层
		
		};
		
		//点击后进行评分处理
		aLi[i - 1].onclick = function (){
		
			iStar = this.index;
			
			var oUl = oStar.getElementsByTagName("input")[0];
			oUl.value=iStar;
		
			
			
		}
	}
	
	//评分处理
	function fnPoint(iArg){
		//分数赋值
		iScore = iArg || iStar;
		for (i = 0; i < aLi.length; i++) aLi[i].className = i < iScore ? "on" : "";	
	}
	
	
	
	
	
	
	var oStar1 = document.getElementById("star1");
	var aLi1 = oStar1.getElementsByTagName("li");
	var oUl1 = oStar1.getElementsByTagName("ul")[0];
	
	
	var i = iScore1 = iStar1 = 0;
	
	for (i = 1; i <= aLi1.length; i++){
		aLi1[i - 1].index = i;
		
		//鼠标移过显示分数
		aLi1[i - 1].onmouseover = function (){
			
			fnPoint1(this.index);
			
			
			};
		
		//鼠标离开后恢复上次评分
		aLi1[i - 1].onmouseout = function (){
			fnPoint1();
			//关闭浮动层
			
		};
		
		//点击后进行评分处理
		aLi1[i - 1].onclick = function (){
		
			iStar1 = this.index;
			
			var oUl1 = oStar1.getElementsByTagName("input")[0];
			oUl1.value=iStar1;
			
			
			
		}
	}
	
	
	//评分处理
	function fnPoint1(iArg){
		//分数赋值
		
		iScore1 = iArg || iStar1;
		for (i = 0; i < aLi1.length; i++) aLi1[i].className = i < iScore1 ? "on" : "";	
	}
	
	
	
	
	
	
	var oStar2 = document.getElementById("star2");
	var aLi2 = oStar2.getElementsByTagName("li");
	var oUl2 = oStar2.getElementsByTagName("ul")[0];
	
	
	var i = iScore2 = iStar2 = 0;
	
	for (i = 1; i <= aLi1.length; i++){
		aLi2[i - 1].index = i;
		
		//鼠标移过显示分数
		aLi2[i - 1].onmouseover = function (){
			
			fnPoint2(this.index);
			
			
			};
		
		//鼠标离开后恢复上次评分
		aLi2[i - 1].onmouseout = function (){
			fnPoint2();
			//关闭浮动层
			
		};
		
		//点击后进行评分处理
		aLi2[i - 1].onclick = function (){
		
			iStar2 = this.index;
			
			var oUl2 = oStar2.getElementsByTagName("input")[0];
			oUl2.value=iStar2;
			
			
			
		}
	}
	
	
	//评分处理
	function fnPoint2(iArg){
		//分数赋值
		
		iScore2 = iArg || iStar2;
		for (i = 0; i < aLi2.length; i++) aLi2[i].className = i < iScore2 ? "on" : "";	
	}
	
	
	
};










$(function (){
	
	var checkboxObj = new Array();
	var checkboxObj=$("body .checkboxFour input");
	
	for(var i=0;i<checkboxObj.size();i++){
		$("#"+checkboxObj[i].id).after("<a herf='#'onclick=checkboxs('"+checkboxObj[i].id+"')  > <img id='"+checkboxObj[i].id+"img' src='<%=request.getContextPath()%>/commonadmin/img/checkbox2.png' /></a>");
		$("#"+checkboxObj[i].id).css("opacity","0");
		$("#"+checkboxObj[i].id).css("position","absolute");
		$("#"+checkboxObj[i].id).css("left","-999em");
	}
	
	
	
	var checkgoodObj = new Array();
	var checkgoodObj=$("body .checkboxGood input");
	
	for(var i=0;i<checkgoodObj.size();i++){
		
		var isChecked = $("#"+checkgoodObj[i].id).prop('checked');
		
		if(isChecked){
			
			$("#"+checkgoodObj[i].id).after("<a herf='#'   ><img  id='"+checkgoodObj[i].id+"img' src='<%=request.getContextPath()%>/commonadmin/img/good2.png' /></a>");
			
		}else{
			$("#"+checkgoodObj[i].id).after("<a herf='#' onclick=checkgoods('"+checkgoodObj[i].id+"')> <img  id='"+checkgoodObj[i].id+"img' src='<%=request.getContextPath()%>/commonadmin/img/good1.png' /></a>");
			
		}
		
		$("#"+checkgoodObj[i].id).hide();
	}
	
	var checkcollectObj = new Array();
	var checkcollectObj=$("body .checkboxCollect input");
	
	for(var i=0;i<checkcollectObj.size();i++){
		
		var isChecked = $("#"+checkcollectObj[i].id).prop('checked');
		if(isChecked){
			
			$("#"+checkcollectObj[i].id).after("<a herf='#' onclick=checkcollects('"+checkcollectObj[i].id+"')  > <img  id='"+checkcollectObj[i].id+"img' style='width: 1em' src='<%=request.getContextPath()%>/commonadmin/img/collect2.png' /></a>");
			
		}else{
			$("#"+checkcollectObj[i].id).after("<a herf='#' onclick=checkcollects('"+checkcollectObj[i].id+"')  > <img  id='"+checkcollectObj[i].id+"img' style='width: 1em' src='<%=request.getContextPath()%>/commonadmin/img/collect1.png' /></a>");
			
		}
		
		$("#"+checkcollectObj[i].id).hide();
	}
	
	
	
	var radioObj = new Array();
	var radioObj=$("body .radioFour input");
	for(var i=0;i<radioObj.size();i++){
		$("#"+radioObj[i].id).hide();
		$("#"+radioObj[i].id).after("<a herf='#'onclick=radios('"+radioObj[i].id+"','"+radioObj[i].name+"')  ><img id='"+radioObj[i].id+"img' for='"+radioObj[i].name+"' src='<%=request.getContextPath()%>/commonadmin/img/radio2.png' /></a>");
		
		if($("#"+radioObj[i].id).prop('checked')){
			$("#"+radioObj[i].id+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/radio.png");
		}
		
	
	}
	
	
	
	var checkradioObj = new Array();
	var checkradioObj=$("body .checkradioFour input");
	for(var i=0;i<checkradioObj.size();i++){
		$("#"+checkradioObj[i].id).hide();
		$("#"+checkradioObj[i].id).after("<a herf='#'onclick=checkradios('"+checkradioObj[i].id+"','"+checkradioObj[i].name+"')  ><img id='"+checkradioObj[i].id+"img' for='"+checkradioObj[i].name+"' src='<%=request.getContextPath()%>/commonadmin/img/checkbox2.png' /></a>");
		
		if($("#"+checkradioObj[i].id).prop('checked')){
			$("#"+checkradioObj[i].id+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/checkbox.png");
		}
		
	
	}
	
	
})



function checkboxs(s){

	var isChecked = $("#"+s).prop('checked');
	
	
	if(isChecked){
		
		$("#"+s).prop("checked",false);
		
		$("#"+s+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/checkbox2.png");
	}else{
		$("#"+s).prop("checked",true);
		
		$("#"+s+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/checkbox.png");
	}
}

function checkradios(s,n,_this){
	var _thisN=$(_this);
	_thisN.parents(".demanddiv1").find(".checkfont").css({"border":"1px solid #cbcbcb","background-color":"#fff","color":"#606060"});
	_thisN.css({"border":"1px solid #fcc300","background-color":"#fcc300","color":"#333"});
	$("input[name='"+n+"']").prop("checked",false);
	$("img[for='"+n+"']").attr("src","<%=request.getContextPath()%>/commonadmin/img/checkbox2.png");
	$("#"+s+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/checkbox.png");
	$("#"+s).prop("checked",true);
	
}


function checkgoods(s){
		
		$("#"+s+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/good2.png");
		getPraise();
}

function checkcollects(s){
	
	var isChecked = $("#"+s).prop('checked');
	
	backfunction($("#"+s).val());

	if(isChecked){

		$("#"+s).prop("checked",false);
		
		$("#"+s+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/collect1.png");
		
	}else{
		$("#"+s).prop("checked",true);
		
		$("#"+s+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/collect2.png");
		
	}
}


function radios(s,n,_this){
	var _thisN=$(_this);
	_thisN.parents(".radioFour").siblings(".radioFour").find(".checkfont").css({"border":"1px solid #cbcbcb","background-color":"#f7f7f7","color":"#606060"});
	_thisN.css({"border":"1px solid #fcc300","background-color":"#fcc300","color":"#333"});
		$("input[name='"+n+"']").prop("checked",false);
		$("img[for='"+n+"']").attr("src","<%=request.getContextPath()%>/commonadmin/img/radio2.png");
		$("#"+s+"img").attr("src","<%=request.getContextPath()%>/commonadmin/img/radio.png");
		$("#"+s).prop("checked",true);
		
}





</script> 
